package 笔试.微众移行.one;


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for (int i = 0; i < T; i++) {
//            int k=25;
            Long k = Long.valueOf(sc.nextInt());
            Long tS=k;int ci=0;//0x 1y 2z
            dfs(tS,ci);
            System.out.println(res==true?"YES":"NO");
            res=false;
        }


    }
    static boolean res=false;
    private static void dfs(Long tS, int ci) {
        if(ci==3){
            if(tS==0)res=true;
            return;
        }
        Long one = new Long(1);
        Long z = new Long(0);
        for (Long x = one; x <=1000; x++) {
            Long nts=z;
            if(ci==0)nts=tS-x*x*x;
            else if(ci==1)nts=tS-x*x*x*x;
            else if(ci==2)nts=tS-x*x*x*x*x;

            dfs(nts, ci+1);
        }
        return;
    }
}
